floor

This function returns the largest integral value that is not greater than x.

double floor(double x)

Parameters:
x
The number to round.

Return value:
The largest integral value not greater than x.

Remarks:
This function will always decrease x, except where x is already an integer. For example, the floor of 5.9 will be 5, but the floor of -5.9 will be -6.

Example:
void main()
{
alert("floor test", "floor of 5.9 is "+floor(5.9)+".");
alert("floor test", "floor of 5 is "+floor(5)+".");
alert("floor test", "floor of -5.9 is "+floor(-5.9)+".");
}